import pyautogui
import time

while True:
    try:
        x, y = pyautogui.position()
        print(f"当前鼠标位置的坐标为: ({x}, {y})")
        time.sleep(1)

    except KeyboardInterrupt:
        print("\n异常终止")
        break